home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD008b.dsk
/
ION.TEST.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
11KB
|
325 lines
10 REM <CTRL-J><CTRL-J>INITIALIZE<CTRL-J>
15 DIM W$(60),F$(60),WW$(60),FF$(60)
20 SOUND = 1
30 HIMEM: 16384
40 IF PEEK(24576) = 72 THEN 80
50 PRINT CHR$(4);"BLOAD HIRES CHAR"
60 PRINT CHR$(4);"BLOAD CHAR TABLE"
70 GOSUB 8000
80 HGR2
90 POKE 54,0: POKE 55,96
100 VTAB 1: HTAB 13: PRINT "Larry Seltzer"
110 VTAB 3: HTAB 12: PRINT "proudly presents"
120 VTAB 6: HTAB 14: PRINT "THE Ion Test"
130 VTAB 10: HTAB 1: PRINT "Which format would you like?"
140 VTAB 12: HTAB 1: PRINT "1. Given FORMULA, enter NAME"
150 VTAB 14: HTAB 1: PRINT "2. Given NAME, enter FORMULA"
160 PRINT : PRINT : PRINT "3. Get instructions"
170 VT = 21: GOSUB 17000
180 TS = VAL(G$)
190 IF TS > = 1 AND TS < = 3 THEN 1000
200 VTAB 23: PRINT "Invalid entry!"
210 POKE 6,10: POKE 7,150: CALL 768
220 VTAB 23: HTAB 1: PRINT " "
230 GOTO 170
500 REM <CTRL-J><CTRL-J>SUBSCRIPT PRINTOUT<CTRL-J>
510 L = LEN(A$):S = 0
520 FOR J = 1 TO L
530 L$ = MID$ (A$,J,1)
540 IF L$ = "+" OR L$ = "-" THEN S = 1
550 IF S = 1 THEN 570
560 IF ASC(L$) >48 AND ASC(L$) <57 THEN SK = 1
570 VTAB VT +SK: HTAB HT +J -1: PRINT L$
580 SK = 0
590 NEXT J
600 RETURN
1000 REM <CTRL-J><CTRL-J>PROGRAM START<CTRL-J>
1010 IF TS = 3 THEN 10000
1020 HGR2 : RESTORE
1030 START = 1:FINISH = 60:TRY = 1
1060 VTAB 11: HTAB 1: PRINT "Reading data ....."
1070 FOR X = START TO FINISH
1080 READ W$(X),F$(X)
1090 NEXT X
1100 VTAB 11: HTAB 1: PRINT "Randomizing data ....."
1110 FOR X = START TO FINISH:C = INT( RND(8) *FINISH) +1
1120 A$ = W$(X):W$(X) = W$(C):W$(C) = A$
1130 A$ = F$(X):F$(X) = F$(C):F$(C) = A$
1140 NEXT X
1150 HGR2 :VT = 1:HT = 1
1160 IF TS = 2 THEN SU = 1: GOTO 1180
1170 SU = 0
1180 FOR X = START TO FINISH
1190 HGR2 :VT = 1:HT = 1
1200 VT = VT +1: VTAB VT
1210 IF TS = 1 THEN A$ = F$(X): GOTO 1230
1220 A$ = W$(X)
1230 GOSUB 500
1240 VT = VT +3: VTAB VT
1250 IF TS = 1 THEN PRINT "Enter name": GOTO 1270
1260 PRINT "Enter formula"
1270 VT = VT +2: GOSUB 17000
1280 IF G$ = "E" OR G$ = "e" THEN 1600
1290 POKE -16368,0
1300 IF TS = 1 THEN 1340
1310 LL = LEN(F$(X))
1320 IF F$(X) = LEFT$(G$,LL) THEN 1520
1330 GOTO 1400
1340 L = LEN(G$):LL = LEN(W$(X))
1350 IF L < >LL THEN 1400
1360 FOR Y = 1 TO L
1370 L$ = MID$ (G$,Y,1):LL$ = MID$ (W$(X),Y,1)
1380 IF L$ < >LL$ AND ASC(L$) +32 < > ASC(LL$) AND ASC(L$) -32 < > ASC(LL$) THEN 1400
1390 NEXT Y: GOTO 1520
1400 PRINT : PRINT "That's not correct"
1401 IF NOT SOUND THEN 1410
1405 FOR J = 10 TO 100 STEP 10
1407 POKE 6,J: POKE 7,5: CALL 768: NEXT J
1410 W = W +1
1420 WW$(W) = W$(X):FF$(W) = F$(X)
1430 IF TS = 2 THEN 1480
1440 PRINT : PRINT "The correct name is ...."
1450 PRINT : HTAB (40 - LEN(W$(X)))/2
1460 PRINT W$(X)
1470 GOTO 1540
1480 PRINT : PRINT "The correct formula is ...."
1490 PRINT :HT = (40 - LEN(F$(X)))/2
1500 VT = 13:CENTER = 1:A$ = F$(X): GOSUB 500
1510 GOTO 1540
1520 PRINT : PRINT "RIGHT
1521 IF NOT SOUND THEN 1530
1522 FOR J = 100 TO 2 STEP -8
1524 POKE 6,J: POKE 7,4: CALL 768
1525 NEXT
1530 R = R +1
1540 VTAB 16
1550 PRINT "Press the SPACE BAR to continue"
1560 IF PEEK( -16384) = 160 THEN 1580
1570 GOTO 1560
1580 POKE -16368,0
1590 NEXT X
1600 HGR2 :X = 0:SUB = 0
1610 HTAB 14: VTAB 1: PRINT "Total Score"
1620 VTAB 3: HTAB 1: PRINT "Try # ";TRY
1630 PRINT : PRINT "Right :";R, INT((R/(R +W) *100) *10 +.5)/10;"%"
1640 PRINT : PRINT "Wrong :";W, INT((W/(R +W) *100) *10 +.5)/10;"%"
1650 PRINT : PRINT "Would you like to ...."
1660 X = X +1
1670 IF W = 0 THEN 1700
1680 PRINT : PRINT X". Try again on the ones you missed"
1690 X = X +1
1700 PRINT : PRINT X". Start the test over from the start"
1710 X = X +1
1720 PRINT : PRINT X". End the test."
1730 PRINT : PRINT "Enter your choice"
1740 VT = 20: GOSUB 17000
1750 G = VAL(G$)
1760 ON G +1 *(W = 0) GOTO 1770,80,20000
1770 TRY = TRY +1
1780 FOR X = 1 TO W
1790 W$(X) = WW$(X):F$(X) = FF$(X)
1800 NEXT X
1810 START = 1:FINISH = W:W = 0:R = 0
1820 IF TS = 2 THEN SUB = 1
1830 HGR2
1840 GOTO 1100
8000 REM <CTRL-J><CTRL-J>MUSICAL POKES
8010 POKE 768,173: POKE 769,48: POKE 770,192: POKE 771,136: POKE 772,208: POKE 773,4: POKE 774,198: POKE 775,7
8020 POKE 776,240: POKE 777,8: POKE 778,202: POKE 779,208: POKE 780,246: POKE 781,166: POKE 782,6: POKE 783,76: POKE 784,0: POKE 785,03: POKE 786,96
8030 RETURN
10000 REM <CTRL-J><CTRL-J>INSTRUCTIONS<CTRL-J>
10010 HGR2 : VTAB 1
10020 PRINT TAB( 14);"Instructions"
10030 PRINT : PRINT "You should know something about IONS if"
10040 PRINT : PRINT "you are going to take this test. If you";
10050 PRINT : PRINT "don't, it won't make much sense."
10060 PRINT : PRINT : PRINT "You have a choice as to how you would"
10070 PRINT : PRINT "like to be tested. You can see the name";
10080 PRINT : PRINT "and type in the formula, or see the"
10090 PRINT : PRINT "formula and type in the name."
10100 GOSUB 15000
10110 PRINT : PRINT "If you are entering the FORMULA:"
10120 PRINT : PRINT
10130 PRINT : PRINT "1. You MUST enter lowercase letters"
10140 PRINT : PRINT " where appropriate. Use ESC to shift";
10150 PRINT : PRINT " between upper and lowercase."
10160 PRINT : PRINT " ESC = next key uppercase."
10170 PRINT : PRINT " ESC ESC = shift lock."
10180 PRINT : PRINT " ESC in shift lock mode will return"
10190 PRINT : PRINT " you to lowercase
10200 GOSUB 15000
10210 PRINT : PRINT "2. The ion's charge MUST be entered in"
10220 PRINT : PRINT " addition to the formula. A positive";
10230 PRINT : PRINT " charge is entered as '+', and a"
10240 PRINT : PRINT " negative charge is entered as '-'."
10250 PRINT : PRINT " If the charge is greater than 1,"
10260 PRINT : PRINT " type the sign, then the number."
10270 PRINT : PRINT " (example: +2, -3)"
10280 PRINT
10290 PRINT : PRINT " IF THE MAGNITUDE OF THE CHARGE IS 1,";
10300 PRINT : PRINT " THEN USE ONLY '+' OR '-', NOT '+1'"
10310 PRINT : PRINT " OR '-1'."
10320 GOSUB 15000
10330 PRINT "3. You MUST have ONE SPACE between the"
10340 PRINT : PRINT " last letter of the formula and the"
10350 PRINT : PRINT " sign of the charge."
10360 GOSUB 15000
10370 PRINT "If you are entering the NAME:"
10380 PRINT : PRINT "1. You may type the name in upper or "
10390 PRINT : PRINT " lowercase letters."
10400 PRINT : PRINT : PRINT "2. If you want to type in 'IRON II',"
10410 PRINT : PRINT " don't type in 'IRON 2'."
10420 PRINT : PRINT " USE ONLY ROMAN NUMERALS."
10430 GOSUB 15000
10440 PRINT "Typing CTRL-S anytime the computer is"
10450 PRINT : PRINT "waiting for input will toggle the sound"
10460 PRINT : PRINT "between on and off. (the CTRL-S will"
10470 PRINT : PRINT "NOT become part of your input)."
10480 PRINT : PRINT : PRINT "Typing in 'E' in place of an answer"
10490 PRINT : PRINT "will end a round of questioning."
10500 GOSUB 15000
10510 GOTO 80
12000 REM <CTRL-J><CTRL-J>DATA<CTRL-J>
12010 DATA acetate,CH3COO -
12020 DATA aluminum,Al +3
12030 DATA ammonium,NH4 +
12040 DATA barium,Ba +2
12050 DATA bismuth,Bi +3
12060 DATA bromide,Br -
12070 DATA cadmium,Cd +2
12080 DATA calcium,Ca +2
12090 DATA carbonate,CO3 -2
12100 DATA chlorate,ClO3 -2
12110 DATA chloride,Cl -
12120 DATA chlorite,Cl2 -
12130 DATA chromate,CrO4 -2
12140 DATA chromium III,Cr +3
12150 DATA cobalt II,Co +2
12160 DATA copper I,Cu +
12170 DATA copper II,Cu +2
12180 DATA cyanide,CN -
12190 DATA dichromate,Cr2O7 -2
12200 DATA dihydrogen phosphate,H2PO4 -
12210 DATA flouride,F -
12220 DATA hydride,H -
12230 DATA hydrogen,H +
12240 DATA hydrogen carbonate,HCO3 -
12250 DATA hydrogen sulfate,HSO4 -
12260 DATA hydrogen sulfite,HSO3 -
12270 DATA hydronium,H3O +
12280 DATA hydroxide,OH -
12290 DATA hypochlorite,ClO -
12300 DATA iodate,IO3 -
12310 DATA iodide,I -
12320 DATA iron II,Fe +2
12330 DATA iron II,Fe +3
12340 DATA lead II,Pb +2
12350 DATA lithium,Li +
12360 DATA magnesium,Mg +2
12370 DATA manganese,Mn +
12380 DATA mercury I,Hg2 +2
12390 DATA mercury II,Hg +2
12400 DATA monohydrogen phosphate,HPO4 -2
12410 DATA nickel II,Ni +2
12420 DATA nitrate,NO3 -
12430 DATA nitrite,NO2 -
12440 DATA oxalate,C2O4 -2
12450 DATA oxide,O -2
12460 DATA perchlorate,ClO4 -
12470 DATA permanganate,MnO4 -
12480 DATA peroxide,O2 -2
12490 DATA phosphate,PO4 -3
12500 DATA phosphite,PO3 -3
12510 DATA potassium,K +
12520 DATA silver,Ag +
12530 DATA sodium,Na +
12540 DATA strontium,Sr +2
12550 DATA sulfate,SO4 -2
12560 DATA sulfide,S -2
12570 DATA sulfite,SO3 -2
12580 DATA thiocyanate,SCN -
12590 DATA tin II,Sn +2
12600 DATA tin IV,Sn +4
12610 DATA zinc,Zn +2
15000 REM <CTRL-J><CTRL-J>PRESS ANY KEY<CTRL-J>
15010 POKE -16368,0
15020 CU$ = "!/-\": VTAB 24
15030 PRINT "! Press any key"
15040 C = 1:L = 4
15050 VTAB 24: HTAB 1: PRINT MID$ (CU$,C,1)
15060 KEY = PEEK( -16384): IF KEY <128 THEN C = C +1 -L *(C = L): GOTO 15050
15070 HGR2 : VTAB 1: RETURN
17000 REM <CTRL-J><CTRL-J>HIRES INPUT<CTRL-J>
17010 POKE -16368,0
17020 HTAB 1: VTAB VT
17030 PRINT "===> "
17040 HT = 4
17050 G$ = ""
17060 A = PEEK( -16384)
17070 VTAB VT: HTAB HT +1: PRINT " "
17080 VTAB VT: HTAB HT +1: PRINT CHR$(95)
17090 IF A <127 THEN 17060
17100 POKE -16368,0
17110 IF A = 141 THEN 17610
17120 IF A = 155 THEN 17590
17130 IF A < >147 THEN 17160
17140 SOUND = SOUND +1: IF SOUND = 2 THEN SOUND = 0
17150 GOTO 17060
17160 IF A < >136 THEN 17380
17170 IF NOT SOUND THEN 17210
17180 FOR Z = 1 TO 20 STEP 5
17190 POKE 6,Z: POKE 7,2: CALL 768
17200 NEXT
17210 L = LEN(G$)
17220 IF L >1 THEN 17320
17230 IF L = 1 THEN 17290
17240 IF NOT SOUND THEN 17290
17250 FOR Y = 1 TO 10
17260 FOR Z = 1 TO 25 STEP 6
17270 POKE 6,Z: POKE 7,3: CALL 768
17280 NEXT : NEXT
17290 VTAB VT: HTAB 5: PRINT " "
17300 G$ = "":HT = 4
17310 GOTO 17060
17320 L = L -1
17325 IF RIGHT$(G$,1) = "+" OR RIGHT$(G$,1) = "-" THEN S = 0
17330 G$ = LEFT$(G$,L)
17340 HT = L +4
17350 VTAB VT: HTAB HT +1: PRINT " "
17360 VTAB VT +1: HTAB HT +1: PRINT " "
17370 GOTO 17060
17380 A = A -128
17390 IF A >64 AND A <91 THEN 17420
17400 A$ = CHR$(A)
17410 GOTO 17430
17420 A$ = CHR$(A +32 -32 *(UC >0))
17430 G$ = G$ +A$
17440 L = LEN(G$)
17450 HT = L +4
17460 IF SUB = 0 THEN 17520
17470 IF A$ = "+" OR A$ = "-" THEN S = 1
17480 IF S = 1 THEN 17520
17490 IF ASC(A$) <48 OR ASC(A$) >57 THEN 17520
17500 VTAB VT +1: HTAB HT: PRINT A$
17510 VTAB VT: HTAB HT: PRINT " ": GOTO 17530
17520 VTAB VT: HTAB HT: PRINT A$
17530 IF UC = 1 THEN UC = 0
17540 IF NOT SOUND THEN 17580
17550 FOR Z = 20 TO 1 STEP -2
17560 POKE 6,Z: POKE 7,2: CALL 768
17570 NEXT
17580 GOTO 17060
17590 UC = UC +1: IF UC = 3 THEN UC = 0
17600 GOTO 17060
17610 VTAB VT: HTAB HT +1: PRINT " "
17620 IF NOT SOUND THEN 17670
17630 FOR Y = 1 TO 3
17640 FOR Z = 40 TO 1 STEP -4
17650 POKE 6,Z: POKE 7,2: CALL 768
17660 NEXT : NEXT
17670 VT = VT +2
17680 RETURN
20000 REM <CTRL-J><CTRL-J>END<CTRL-J>
20010 TEXT
20020 HOME
20030 END